<!-- 报告上传统计-->
<#macro reportcount > 
<#if USER.userType != "st">
<div class="col-sm-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>最近7天上传报告统计</h5>
            <div class="ibox-tools">
            </div>
        </div>
        <div class="ibox-content" style="height: 341px;"> 
	           <div style="width: 100%;height:349px;" id="flot-dashboard-chart"></div>
        </div>
    </div>
</div>

<script>
$(function(){ 
	
	<@portsCount type="tb">
	option = {
	    tooltip : {
	        trigger: 'axis'
	    },
	    legend: {
	        data:${map.legendData}
	    },
	    toolbox: {
	        show : true
	    },
	    calculable : true,
	    xAxis : [
	        {
	            type : 'category',
	            data : ${map.xAxisData}
	        }
	    ],
	    yAxis : [
	        {
	            type : 'value'
	        }
	    ],
	    series : ${map.seriesData}
	}; 
	</@portsCount>
	
	 var l = echarts.init(document.getElementById("flot-dashboard-chart"));
	 var markPointv = {
	    data : [
	        {type : 'max', name: '最大值'},
	        {type : 'min', name: '最小值'}
	    ]
	 };
     option.series[0].markPoint = markPointv;
	 option.series[1].markPoint = markPointv;
	 option.series[2].markPoint = markPointv;
	 option.series[3].markPoint = markPointv;
	 l.setOption(option);
	 $(window).resize(l.resize); 
	 
})
</script>
</#if>
</#macro>



<!-- 报告上传统计-->



<#macro reportdzcount > 
<#if USER.userType != "jcjg">
<div class="col-sm-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5><#if USER.userType == "st">各地州报告上传统计<#elseif USER.userType == "dz">各区县报告上传统计</#if></h5>
            <div class="ibox-tools">
	            <button class="btn btn-primary btn-sm" type="button" id="brack_btn" style="margin-top: -8px;"><i class="glyphicon glyphicon-menu-left"></i>&nbsp;返回</button>
            </div>
        </div>
        <div class="ibox-content" style="height: 440px;padding: 10px 0px 0px;"> 
	           <div class="col-sm-12" id="dzscbgtj_bar" style="height: 380px;"></div>
        </div>
    </div>
</div> 
<!-- 按月统计-->
<div class="col-sm-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>按月报告上传统计</h5>
        </div>
        <div class="ibox-content" style="height: 440px;padding: 10px 0px 0px;"> 
	           <div class="col-sm-12" id="dzscbgtjmonth_bar" style="height: 380px;"></div>
        </div>
    </div>
</div>
<script>
var cityMap = null;
$(function(){ 
	initGdztjMonth("","init",""); 
	initGdztjMonthNew("","init","");
	$("#brack_btn").click(function(){
		initGdztjMonth("","init",""); 
	});
});


function initGdztjMonth(areaId,type,title){
	  if(type=="init"){
	  	 $("#brack_btn").hide(); 
	  }else{
	  	 $("#brack_btn").show(); 
	  }
	  var echarts_dzscbgtj_bar = echarts.init(document.getElementById("dzscbgtj_bar"));
	  echarts_dzscbgtj_bar.showLoading({
	            text: "图表数据正在努力加载..."
	  });
	  echarts_dzscbgtj_bar.on('click', function (param) {
	      initGdztjMonth(cityMap[param.name],'query',param.name);
      });
	  $.ajax({
		type: 'GET',
		url: '${WEB_PATH }/ports/report/gdzscbgtj.do',  
		data: {areaId:areaId},
		dataType: "json",
		success:function(result){
			if(result.success){
			    echarts_dzscbgtj_bar.hideLoading();
			    cityMap = result.cityMap;
				var markPointv = {
				    clickable:false,
	                data : [
	                    {type : 'max', name: '最大值'},
	                    {type : 'min', name: '最小值'}
	                ]
	            };
	            for(var x=0;x<result.barseriesData.length;x++){
	            	result.barseriesData[x].markPoint = markPointv;
	            }
				var option = initOption(result.barLegend,result.xAxisData,result.barseriesData,type);
				echarts_dzscbgtj_bar.setOption(option), 
				$(window).resize(echarts_dzscbgtj_bar.resize);
				
			}else{
				layer.msg('<font color="red">统计数据出现问题，请稍后再试！。</font>', {icon: 5}); 
			}
		}
	  });   
}
 ///// 按月统计各检测站检车数量
function initGdztjMonthNew(areaId,type,title){
	  if(type=="init"){
	  	 $("#brack_btn").hide(); 
	  }else{
	  	 $("#brack_btn").show(); 
	  }
	  var echarts_dzscbgtj_bar = echarts.init(document.getElementById("dzscbgtjmonth_bar"));
	  echarts_dzscbgtj_bar.showLoading({
	            text: "图表数据正在努力加载..."
	  });
	  $.ajax({
		type: 'GET',
		url: '${WEB_PATH }/ports/report/getNumMonth.do',  
		data: {areaId:areaId},
		dataType: "json",
		success:function(result){
			if(result.success){
			    echarts_dzscbgtj_bar.hideLoading();
			
				var option = initOptionMonth(result.xAxisData,result.seriesData);
				
				echarts_dzscbgtj_bar.setOption(option); 
				
				
			}else{
				layer.msg('<font color="red">统计数据出现问题，请稍后再试！。</font>', {icon: 5}); 
			}
		},
		error:function(){
		    alert("加载失败");
		}
	  });   
}
///// 按月统计各检测站检车数量
function initOptionMonth(xAxisDatas,seriesDatas){
  var option = {
    tooltip : {
        trigger: 'axis'
    },
    legend: {
        data:['检测总数']
    },
    toolbox: {
        show : true,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {show: true, type: ['line', 'bar']},
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : xAxisDatas
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'检测总数',
            type:'line',
            smooth:true,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data:seriesDatas
        },
    ]
};
   return option;
}

function initOption(barLegend,xAxisData,seriesData,type){
    var axisLabel_v = {
         interval:0,
         rotate:30,
         margin:2,
         <#if USER.userType == "st">
         clickable:true,
         </#if>
         textStyle:{
             color:"lightskyblue",
             fontWeight:"bold"
         }
    };
	var option = {
	    tooltip : {
	        trigger: 'axis'
	    },
	    legend: {
	        data:barLegend
	    },
	    calculable : true,
	    xAxis : [
	        {
	            type : 'category',
	            data : xAxisData
	        }
	    ],
	    grid:{
		       y2:80
		},
	    yAxis : [
	        {
	            type : 'value'
	        }
	    ],
	    series : seriesData
	}; 
	if(type == "init"){
		option.xAxis[0].axisLabel = axisLabel_v;
	} 
	return option;
}


</script>
</#if>
</#macro>


<#macro reportcount1 > 
<@portsCount type="wz">
<div class="col-sm-3">
    <div class="ibox">
        <div class="ibox-content" style="text-align: center;color: coral;">
            <h4 >点燃式发动机汽车稳定工况法排气污染物检测报告</h4>
            <h1 class="no-margins" id="epa_table_conditions_method">0</h1> 
            <#if USER.userType == "dz">
	            <@portsCount type="zt" tableName="epa_table_conditions_method">
	            <div class="row" style="padding-top: 15px;">
	                <div class="col-sm-6" style="text-align: left;color: red;">
	                	 <#if ztcount.sdsh gt 0>
	                	 	<a data-name="点燃式发动机汽车稳定工况法排气污染物检测报告-----检测报告审核" data-url="${WEB_PATH }/ports/report/bgshindex.do?tableName=epa_table_conditions_method" class="btn-outline btn-danger btn-xs tabClass"><i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}</a>
	                	 <#else>
	                	 	<i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}
	                	 </#if>
	            	</div>
	            	<div class="col-sm-6" style="text-align: right;">
	                	<span style="color: #1ab394;"><i class="iconfont" style="font-size:14px;font-style:normal;">&#xe764;</i>&nbsp;通过</span>/<span style="color: #f8ac59;">未通过</span>：
	                	<span style="color: #1ab394;">${ztcount.tg}</span>/<span style="color: #f8ac59;">${ztcount.wtg}</span>
	            	</div>
	            </div>
	            </@portsCount>
            </#if>
        </div>
    </div>
</div>
<div class="col-sm-3">
    <div class="ibox">
        <div class="ibox-content" style="text-align: center;color: lightskyblue;">
            <h4>点燃式发动机汽车双怠速法排气污染物检测报告</h4>
            <h1 class="no-margins" id="epa_test_lambda_info">0</h1>
            <#if USER.userType == "dz">
	            <@portsCount type="zt" tableName="epa_test_lambda_info">
	            <div class="row" style="padding-top: 15px;">
	                <div class="col-sm-6" style="text-align: left;color: red;">
	                	 <#if ztcount.sdsh gt 0>
	                	 	<a data-name="点燃式发动机汽车双怠速法排气污染物检测报告-----检测报告审核" data-url="${WEB_PATH }/ports/report/bgshindex.do?tableName=epa_test_lambda_info" class="btn-outline btn-danger btn-xs tabClass"><i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}</a>
	                	 <#else>
	                	 	<i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}
	                	 </#if>
	            	</div>
	            	<div class="col-sm-6" style="text-align: right;color: #f8ac59;">
	                	<span style="color: #1ab394;"><i class="iconfont" style="font-size:14px;font-style:normal;">&#xe764;</i>&nbsp;通过</span>/<span style="color: #f8ac59;">未通过</span>：
	                	<span style="color: #1ab394;">${ztcount.tg}</span>/<span style="color: #f8ac59;">${ztcount.wtg}</span>
	            	</div>
	            </div>
	            </@portsCount>
            </#if>
        </div>
    </div>
</div>
<div class="col-sm-3">
    <div class="ibox">
        <div class="ibox-content" style="text-align: center;color: orchid;">
            <h4>在用汽车自由加速试验（不透光烟度法）检测报告</h4>
            <h1 class="no-margins" id="epa_opacity_smoke_method">0</h1> 
            <#if USER.userType == "dz">
	            <@portsCount type="zt" tableName="epa_opacity_smoke_method">
	            <div class="row" style="padding-top: 15px;">
	                <div class="col-sm-6" style="text-align: left;color: red;">
	                	 <#if ztcount.sdsh gt 0>
	                	 	<a data-name="在用汽车自由加速试验（不透光烟度法）检测报告-----检测报告审核" data-url="${WEB_PATH }/ports/report/bgshindex.do?tableName=epa_opacity_smoke_method" class="btn-outline btn-danger btn-xs tabClass"><i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}</a>
	                	 <#else>
	                	 	<i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}
	                	 </#if>
	            	</div>
	            	<div class="col-sm-6" style="text-align: right;color: #f8ac59;">
	                	<span style="color: #1ab394;"><i class="iconfont" style="font-size:14px;font-style:normal;">&#xe764;</i>&nbsp;通过</span>/<span style="color: #f8ac59;">未通过</span>：
	                	<span style="color: #1ab394;">${ztcount.tg}</span>/<span style="color: #f8ac59;">${ztcount.wtg}</span>
	            	</div>
	            </div>
	            </@portsCount>
            </#if>
        </div>
    </div>
</div>
<div class="col-sm-3">
    <div class="ibox">
        <div class="ibox-content" style="text-align: center;color: limegreen;">
            <h4>在用汽车加载减速法排气烟度检测报告</h4>
            <h1 class="no-margins" id="epa_load_reduction_method">0</h1> 
            <#if USER.userType == "dz">
	            <@portsCount type="zt" tableName="epa_load_reduction_method">
	            <div class="row" style="padding-top: 15px;">
	                <div class="col-sm-6" style="text-align: left;color: red;">
	                	 <#if ztcount.sdsh gt 0>
	                	 	<a data-name="在用汽车加载减速法排气烟度检测报告-----检测报告审核" data-url="${WEB_PATH }/ports/report/bgshindex.do?tableName=epa_load_reduction_method" class="btn-outline btn-success btn-xs tabClass">  <i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}</a>
	                	 <#else>
	                	 	<i class="iconfont" style="font-size:14px;font-style:normal;"></i>待审核：${ztcount.sdsh}
	                	 </#if>
	            	</div>
	            	<div class="col-sm-6" style="text-align: right;color: #f8ac59;">
	                	<span style="color: #1ab394;"><i class="iconfont" style="font-size:14px;font-style:normal;">&#xe764;</i>&nbsp;通过</span>/<span style="color: #f8ac59;">未通过</span>：
	                	<span style="color: #1ab394;">${ztcount.tg}</span>/<span style="color: #f8ac59;">${ztcount.wtg}</span>
	            	</div>
	            </div>
	            </@portsCount>
            </#if>
        </div>
    </div>
</div>
<script>
$(function(){ 
	 <#list bgList as bg >
		 var ${bg.BGB} = new CountUp("${bg.BGB}", 0, ${bg.BGCOUNT}, 0, 2.5);
		 ${bg.BGB}.start();
     </#list> 
})
</script>
</@portsCount>
</#macro>
<!-- 报告上传统计 -->
 
 